package com.acme.superchat.service.history;

import com.acme.superchat.service.server.ChatWorker;

import java.util.Date;

/**
 * Class stores history record information
 * @author Alexander Kotov (kotov.alex.22@gmail.com)
 */
public class HistoryRecord {
    private final Date date;
    private final String name;
    private final String message;
    private final String room;

    /**
     * The default constructors
     * @param date
     * @param name
     * @param message
     * @param room
     */
    public HistoryRecord(Date date, String name, String message, String room) {
        this.date = date;
        this.name = name;
        this.message = message;
        this.room = room;
    }

    /**
     * @return the date
     */
    public Date getDate() {
        return date;
    }

    /**
     * @return the message
     */
    public String getMessage() {
        return message;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @return the room
     */
    public String getRoom() {
        return room;
    }

    /**
     * @return the strings
     */
    @Override
    public String toString() {
        return String.format("%s: %s: %s", date, name, message);
    }
}
